<?php
/**
 * Created by PhpStorm.
 * User: jieaido
 * Date: 2017/3/31
 * Time: 9:44
 */
namespace Admin\Model;

use Think\Model\RelationModel;
class UserRelationModel extends RelationModel{
    protected $tableName='user';

    protected $_link=array(
      'role'=>array(
          'class_name' => 'role',
            'mapping_type'=>self::MANY_TO_MANY,
            'foreign_key'=>'user_id',
            'relation_foreign_key'=>'role_id',
          'relation_table' => 'think_role_user'



      )
    );

}